/* eslint-disable no-var */
'use strict';

const Controller = require('egg').Controller;
const { ObjectId } = require('mongodb');

class HomeController extends Controller {
  async find(id = null) {
    var db = this.app.mongodb;
    var res = await db.collection('article').find({ _id: ObjectId(id) }).toArray();
    return res;
  }
}

module.exports = HomeController;
